package aop;

import org.aspectj.lang.ProceedingJoinPoint;

/**
 * JoinPoint
 * 
 * @author Wangpeihu
 * @team [Never give up]
 * @since JDK1.6(建议)
 * @date 2010-2-9
 */
public class Time2 {

	/**
	 * 在这里ProceedingJoinPoint,简称连接点,表示能切的候选人,<br>
	 * 所有的能切的都是JoinPoint,JoinPoint只局限于方法
	 * 
	 * @param pj
	 * @return
	 * @throws Throwable
	 */
	public Object around(ProceedingJoinPoint pj) throws Throwable {
		long begin = System.nanoTime();
		Object result = pj.proceed();
		long end = System.nanoTime();
		System.out.println(pj.getSignature().getName() + ",Runing:"
				+ (end - begin) + "ms");

		return result;
	}
}
